home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / QuickTime / QuickTime VR / Make QTVR Object / MakeQTVRObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.4 KB  |  157 lines  |  [TEXT/CWIE]

  1. #include <QuickTimeComponents.h>
  2. #include <Movies.h>
  3. #include <PLStringFuncs.h>
  4. #include "QTVRObjectAuthoring.h"
  5.  
  6. enum {
  7.     iOpen = 1,
  8.     iClose,
  9.     iDrop = 4,    
  10.     iSetPrefs = 6,
  11.     iQuit = 8
  12.     };
  13.  
  14. enum {
  15.     iUndo = 1,
  16.     iCut = 3,
  17.     iCopy,
  18.     iPaste,
  19.     iClear,
  20.     iMakeObject = 8,
  21.     iDeleteObject,
  22.     iSetPoster,
  23.     iShowPoster
  24.     };
  25.  
  26. enum {
  27.     iAbout = 1
  28.     };
  29.  
  30.     
  31. enum    {
  32.     appleID = 128,
  33.     fileID,
  34.     editID
  35.     };
  36.  
  37. enum    {
  38.     kGenericMessageDLOG = 128,
  39.     kAboutDLOG,
  40.     kObjectDLOG,
  41.     kGenericQuestionDLOG,
  42.     kSplashDLOG
  43.     };
  44.  
  45. enum {
  46.     iOK             = 1,
  47.     iCancel,
  48.     iVersionNumber,
  49.     iNumberOfRows,
  50.     iNumberOfColumns,
  51.     iLoopSize,
  52.     iLoopTicks,
  53.     iStartHPan,
  54.     iEndHPan,
  55.     iStartVPan,
  56.     iEndVPan,
  57.     iFieldOfView,
  58.     iScene,
  59.     iObject,
  60.     iObjectInScene,
  61.     iUseObject,
  62.     iDummyLastEnum
  63. };
  64. enum {
  65.     kNotAQTVRMovie            =    -8765
  66. };
  67.  
  68. enum {
  69.     kQTVRPano                =    'pano',
  70.     kQTVRNavigable            =    'navg',
  71.     kNotAQTVRType            =    0            // Must be zero
  72. };
  73.  
  74. #define kDefaultCancel    3
  75. #define    kDefaultOK        2    
  76. #define    kMessageID        1    
  77. #define    kPrefsFileName    "\pMake QTVR Object Prefs"
  78. #define kAppCreator        'obod'
  79.  
  80. #define Fix2Float(x)    ((float)x)/65536.0
  81. #define Float2Fix(x)    (Fixed)(x*65536.0)
  82.  
  83. typedef struct    
  84.     {
  85.     Movie            movie;                    /* The movie to play */
  86.     CWindowPtr        window;                    /* Window the movie is played in */
  87.     MovieController    movieController;        /* The controls for the movie */
  88.     FSSpec             spec;                    /* The file spec fo rthe movie */
  89.     short            movieResFile;
  90.     short            movieResID;
  91.     Boolean            isObjectMovie;
  92.     } MovieInstance;
  93.     
  94. #pragma options align=mac68k
  95. typedef struct
  96.     {
  97.     short                            dropMode;
  98.     QTVRObjectFileFormat1x0Record    objectInfo;
  99.     } PrefInfo;
  100. #pragma options align=reset
  101.     
  102. // Apple Events
  103. void    AEInit();
  104. Boolean SupportsAEVT(void);
  105. void RegisterMyEvents(void);
  106. pascal    OSErr    DoOpenApp(AppleEvent    *theAppleEvent,AppleEvent *reply,long    RefCon);
  107. pascal    OSErr    DoQuitApp(AppleEvent    *theAppleEvent,AppleEvent *reply,long    RefCon);
  108. pascal    OSErr    DoOpenDoc(AppleEvent    *theAppleEvent,AppleEvent *reply,long    RefCon);
  109. pascal    OSErr    DoPrintDoc(AppleEvent    *theAppleEvent,AppleEvent *reply,long    RefCon);
  110.  
  111. // Event Loop
  112. void    MainLoop();
  113. void    DoUpdate(EventRecord        *theEvent);
  114. void    DoMouseDown(EventRecord        *theEvent);
  115. void    KeyDown(char    theChar,char    theChar2);
  116. void    DoNull();
  117.  
  118.  
  119. // Menus
  120. void    DoMenuChoice(long menuResult);
  121. void     EnDisItem (MenuHandle mh, short item, Boolean enable);
  122. void     SetupMenus();
  123. void    About();
  124. void    MenuBarInit();
  125.  
  126. void    ToolBoxInit();
  127. void    Cleanup();
  128.  
  129. float    StringToFloat(StringPtr    theString);
  130. void    FloatToString(float    num,Str255    *theString,short    digits);
  131. void    UserMessage(Str255    theMessage);
  132. Boolean    UserQuestion(Str255    theMessage);
  133.  
  134. Boolean            GetAMovie(FSSpec    *theSpec);
  135. OSErr            OpenMovie(FSSpec    *theFSSpec);
  136. void            CloseMovie();
  137. OSErr            ReopenMovie(MovieInstance    *theInstance);
  138. void             MyMoviesTask(WindowPtr    theWindow);
  139. MovieInstance    *GetMovieInstanceFromWindow(WindowPtr    theWindow);
  140. OSErr            AttachMovieToWindow(WindowPtr    theWindow,MovieInstance    *theMovie);
  141. Boolean         CheckMovieControllers(EventRecord *theEvent);
  142. Boolean            ValidMovieType(MovieInstance    *theInstance);
  143. Boolean         MakeItLinear();
  144. OSErr            OpenPrefs();
  145. OSErr            SavePrefs();
  146. OSErr            RetrievePrefs();
  147. void            Splash();
  148.  
  149. OSErr            HandleMovieFormatDialog (MovieInstance    *theInstance,Boolean    applyValues);
  150. OSErr             DeleteNavMovieData (MovieInstance    *theInstance);
  151. OSErr             DoSetStartUpView (MovieInstance    *theInstance);
  152. void            InitDialogBox(DialogPtr    askBox,QTVRObjectFileFormat1x0Record    *fileFormat);
  153.  
  154.  
  155. pascal Boolean ModalFilter(DialogPtr theDlg,EventRecord    *theEvent,short    *itmeHit);
  156. pascal void OutlineOK(WindowPtr theDlg,short theItem );
  157.